package com.liangzong.betspider.service;

import com.liangzong.betspider.command.Command;
import com.liangzong.betspider.executor.Executor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ManageDataService {

    @Autowired
    List<Executor> executorList;

    //单线程执行CRUD 不会导致数据锁死异常
    public void manage(Command command){
        for(Executor e: executorList){
            if(e.support(command.getType())){
                e.process(command);
            }
        }
    }
}
